﻿<UserControl x:Name="UserInfoControl" x:Class="NicoView.View.NicoViewUserInfoControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vm="http://nicoviewviewmodel"
             xmlns:local="clr-namespace:NicoView.View"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

   

    <UserControl.Background>
        <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.ControlColorKey}}"/>
    </UserControl.Background>

    <UserControl.DataContext>
        <vm:NicoViewUserInfoViewModel/>
    </UserControl.DataContext>


    <Grid Margin="20">
        <Grid.Background>
            <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.DesktopColorKey}}"/>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Text="ユーザ情報" Background="Black" HorizontalAlignment="Center" Margin="0,20" FontSize="18" >
            <TextBlock.Foreground>
                <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.WindowColorKey}}"/>
            </TextBlock.Foreground>
        </TextBlock>
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,20,0">
            <Image Height="64" Source="{Binding UserIconPath, Mode=OneWay}" />
            <Grid Margin="20,0,0,0"  >
                <Grid.RowDefinitions>
                    <RowDefinition Height="25"/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>

                <TextBlock Grid.Row="0" Grid.Column="0" FontSize="18" Text="ユーザID:">
                    <TextBlock.Foreground>
                        <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.WindowColorKey}}"/>
                    </TextBlock.Foreground>
                </TextBlock>
                <TextBox Grid.Row="0" Grid.Column="1" FontSize="18" IsReadOnly="True" Text="{Binding Id, Mode=OneWay}" Background="{x:Null}" BorderBrush="{x:Null}">
                    <TextBlock.Foreground>
                        <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.WindowColorKey}}"/>
                    </TextBlock.Foreground>
                </TextBox>
                <TextBlock Grid.Row="1" Grid.Column="0" FontSize="18" Text="ユーザ名:">
                    <TextBlock.Foreground>
                        <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.WindowColorKey}}"/>
                    </TextBlock.Foreground>
                </TextBlock>
                <TextBox Grid.Row="1" Grid.Column="1" IsReadOnly="True" FontSize="18" Text="{Binding NickName, Mode=OneWay}" Background="{x:Null}" BorderBrush="{x:Null}">
                    <TextBlock.Foreground>
                        <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.WindowColorKey}}"/>
                    </TextBlock.Foreground>
                </TextBox>
                <TextBlock Grid.Row="2" Grid.Column="0" FontSize="18" Text="コテハン:">
                    <TextBlock.Foreground>
                        <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.WindowColorKey}}"/>
                    </TextBlock.Foreground>
                </TextBlock>
                <TextBox Grid.Row="2" Grid.Column="1" FontSize="18" Text="{Binding CustomName,Mode=TwoWay}" />
            </Grid>
            

            
        </StackPanel>
        <TextBlock Grid.Row="2" Margin="0,20,20,20" HorizontalAlignment="Right" >
                <Hyperlink x:Name="UserInfoLink" FontSize="18" Command="{Binding OpenUserLink, Mode=OneWay}" Click="UserInfoLink_Click"  >
                    <Run Text="ユーザ情報ページへ"/>
                </Hyperlink>
        </TextBlock>

        <Grid Grid.Row="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition  />
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            
            <TextBlock Text="背景色:" Grid.Column="1" Background="Black" FontSize="18">
                <TextBlock.Foreground>
                    <SolidColorBrush  Color="{DynamicResource {x:Static SystemColors.WindowColorKey}}"/>
                </TextBlock.Foreground>
            </TextBlock>

            <ComboBox Name="ColorBox" Grid.Column="2"
                          IsReadOnly="True" ItemsSource="{Binding SelectionColors}" SelectedItem="{Binding BackGroundColor}">

                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Margin="3">
                            <Border BorderBrush="Black" BorderThickness="2"
                            CornerRadius="5" Width="20" Height="20"
                            VerticalAlignment="Center"
                            >
                                <Border.Background>
                                    <SolidColorBrush Color="{Binding Color, Mode=OneWay}"/>
                                </Border.Background>

                            </Border>
                            <TextBlock Text="{Binding Name, Mode=OneWay}" />



                        </StackPanel>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
                
            </ComboBox>
            
        </Grid>
        <local:NicoViewCommentViewControl DataContext="{Binding}" Margin="20" Grid.Row="4"/>
        
    </Grid>

    
</UserControl>
